namespace Radar.Test
{
    using System;
    using NUnit.Framework;

    [TestFixture]
    public class LifetimeTest
    {
        [Test]
        public void WillReturnCorrectTypes()
        {
            Assert.That(Lifetime.Singleton, Is.InstanceOf<SingletonLifetime>());
            Assert.That(Lifetime.Transient, Is.InstanceOf<TransientLifetime>());
            Assert.That(Lifetime.ThreadLocal, Is.InstanceOf<ThreadLocalLifetime>());
        }

        [Test, ExpectedException(typeof(ArgumentNullException))]
        public void WillThrowOnNullInitialBuilder()
        {
            Lifetime.Transient.GetBuilder(null);
        }
    }
}